package com.woke.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.zhongcai.online.R;

public class Myloan2Fragment extends Fragment {
	
	private View layout;
	private LayoutInflater minflater;
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		
		if(layout == null){
			minflater = inflater;
			layout = minflater.inflate(R.layout.fmmy_zcai, null);
			intview();
		}else{
			ViewGroup parent = (ViewGroup) layout.getParent();
			if(parent!=null){
				parent.removeView(layout);
			}
		}
		return layout;
	}
	
	private void intview() {
		
		 initMainFragment();
	}
	
	private void initMainFragment(){
        FragmentManager fm = getActivity().getSupportFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        ft.add(R.id.tab_framelayout, new MainFragment());
        ft.commit();
    }
}
